 package com.es.util.db;
 
 import java.io.Serializable;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
 
 @SuppressWarnings("serial")
public class DBBean implements Serializable
 { 
   public DBBean()
     throws Exception
   {
   }
 
   public Connection getConn()
     throws SQLException
   {
     Connection conn = null;
     try
     {
       conn = DriverManager.getConnection("proxool.hrm");
     }
     catch (Exception ex)
     {
       ex.printStackTrace();
     }
 
     return conn;
   }
 
   public void closeConnection(Connection conn)
   {
     if (conn == null)
       return;
     try {
       conn.close();
       conn = null;
     }
     catch (Exception ex)
     {
       ex.printStackTrace();
     }
   }
 
   public void closeStatement(Statement stmt)
   {
     if (stmt == null)
       return;
     try {
       stmt.close();
       stmt = null;
     }
     catch (Exception ex)
     {
       ex.printStackTrace();
     }
   }
 
   public void closePreparedStatement(PreparedStatement pstmt)
   {
     if (pstmt == null)
       return;
     try {
       pstmt.close();
       pstmt = null;
     }
     catch (Exception ex)
     {
       ex.printStackTrace();
     }
   }
 
   public void closeResultSet(ResultSet rs)
   {
     if (rs == null)
       return;
     try {
       rs.close();
       rs = null;
     }
     catch (Exception ex)
     {
       ex.printStackTrace();
     }
   }
 }